# A plotting R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages ("ggplot2"); library (ggplot2); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","log10_p_value","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0006090","pyruvate metabolic process", 0.041,-5.439,-1.576, 3.667,-4.1457,0.830,0.000), c("GO:0006800","oxygen and reactive oxygen species metabolic process", 0.154, 2.637, 7.200, 4.210,-1.5322,0.978,0.000), c("GO:0008544","epidermis development", 0.032,-1.589, 6.700, 3.564,-2.2490,0.858,0.000), c("GO:0022610","biological adhesion", 0.544, 0.396, 0.224, 4.792,-1.1575,0.978,0.000), c("GO:0045185","maintenance of protein location", 0.023, 6.505,-3.168, 3.417,-1.0229,0.855,0.000), c("GO:0007010","cytoskeleton organization", 0.203, 7.339, 0.599, 4.363,-3.5467,0.696,0.018), c("GO:0034614","cellular response to reactive oxygen species", 0.086, 1.307,-7.015, 3.992,-2.3838,0.837,0.019), c("GO:0000278","mitotic cell cycle", 0.103,-6.084, 3.048, 4.068,-1.4116,0.910,0.019), c("GO:0030029","actin filament-based process", 0.106, 3.785,-1.615, 4.084,-1.5028,0.949,0.019), c("GO:0007017","microtubule-based process", 0.308, 5.089, 5.274, 4.546,-1.8184,0.946,0.021), c("GO:0007155","cell adhesion", 0.540, 5.377, 6.380, 4.789,-1.1575,0.945,0.022), c("GO:0044275","cellular carbohydrate catabolic process", 0.982,-2.913,-1.117, 5.049,-2.1479,0.735,0.040), c("GO:0042743","hydrogen peroxide metabolic process", 0.046, 3.380,-3.529, 3.718,-1.5450,0.918,0.040), c("GO:0045333","cellular respiration", 4.810, 1.585, 2.109, 5.739,-1.5256,0.882,0.064), c("GO:0006457","protein folding", 0.973, 0.164,-3.242, 5.045,-1.1452,0.904,0.066), c("GO:0006732","coenzyme metabolic process", 2.448, 2.842, 5.398, 5.445,-1.2780,0.915,0.073), c("GO:0051186","cofactor metabolic process", 3.543,-2.073, 2.671, 5.606,-1.0201,0.913,0.077), c("GO:0006091","generation of precursor metabolites and energy", 6.142, 3.424, 3.204, 5.845,-2.1317,0.909,0.084), c("GO:0046165","alcohol biosynthetic process", 0.378,-6.015,-3.203, 4.634,-2.7955,0.717,0.208), c("GO:0009152","purine ribonucleotide biosynthetic process", 1.244,-5.290,-4.070, 5.151,-1.5539,0.642,0.280), c("GO:0009628","response to abiotic stimulus", 0.404, 0.037,-6.982, 4.664,-1.2524,0.924,0.315), c("GO:0043242","negative regulation of protein complex disassembly", 0.014, 7.276,-0.940, 3.218,-1.8915,0.715,0.423), c("GO:0006414","translational elongation", 0.665,-6.084,-2.077, 4.880,-1.0977,0.871,0.426), c("GO:0044087","regulation of cellular component biogenesis", 0.077, 7.056, 0.186, 3.943,-1.0109,0.783,0.428), c("GO:0051591","response to cAMP", 0.005, 0.729,-6.999, 2.749,-1.2300,0.909,0.460), c("GO:0001763","morphogenesis of a branching structure", 0.026,-2.262, 6.579, 3.470,-1.5282,0.890,0.510), c("GO:0032271","regulation of protein polymerization", 0.027, 7.235,-0.397, 3.489,-1.8428,0.676,0.555), c("GO:0016052","carbohydrate catabolic process", 1.399,-2.435,-2.113, 5.203,-1.3925,0.798,0.557), c("GO:0033554","cellular response to stress", 2.139, 1.599,-6.724, 5.387,-1.0122,0.863,0.557), c("GO:0048754","branching morphogenesis of a tube", 0.021,-2.028, 6.321, 3.372,-1.2229,0.884,0.565), c("GO:0034654","nucleobase-containing compound biosynthetic process", 3.078,-4.493,-4.880, 5.545,-1.0154,0.776,0.593), c("GO:0010035","response to inorganic substance", 0.247, 1.147,-6.832, 4.449,-1.5539,0.891,0.597), c("GO:0000279","M phase", 0.096,-6.088, 3.276, 4.039,-1.3925,0.905,0.631), c("GO:0046364","monosaccharide biosynthetic process", 0.334,-4.694,-2.774, 4.581,-2.4648,0.654,0.648), c("GO:0007444","imaginal disc development", 0.009,-1.869, 6.772, 2.991,-1.1148,0.876,0.651), c("GO:0008064","regulation of actin polymerization or depolymerization", 0.026, 7.033,-0.848, 3.464,-2.4191,0.598,0.655), c("GO:0022402","cell cycle process", 0.220,-5.874, 3.256, 4.400,-1.1831,0.906,0.671), c("GO:0065004","protein-DNA complex assembly", 0.191, 7.394, 0.066, 4.337,-1.1148,0.695,0.679), c("GO:0007398","ectoderm development", 0.003,-1.298, 6.840, 2.464,-1.8476,0.878,0.685)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");